package com.citycloud.ccuap.tc.oauth2;

import java.util.Locale;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;


@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, JpaRepositoriesAutoConfiguration.class,
		MultipartAutoConfiguration.class })
@ComponentScan(basePackages = "com.citycloud.ccuap")
@PropertySource(value = { "*:config/${spring.profiles.active}/global.properties",
		"*:config/${spring.profiles.active}/database.properties",
		"*:config/${spring.profiles.active}/redis.properties" }, ignoreResourceNotFound = true)
@EnableFeignClients("com.citycloud.ccuap.tc.oauth2.feignclient")
public class MainApp {

	private static final String STR_ZH = "zh";

    public static void main(String[] args) {
    	Locale locale = Locale.getDefault();
		System.out.println("当前语言环境：" + locale.getLanguage());
		if(!locale.getLanguage().startsWith(STR_ZH)){
		    Locale.setDefault(Locale.forLanguageTag("zh-CN"));
        }
        System.out.println("最终语言环境：" + Locale.getDefault().getLanguage());
        SpringApplication.run(MainApp.class, args);

    }
}
